<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="/layout/template.xhtml">

<ui:define name="body">
    <h:form>
    <rich:dataTable id="recipes" var="wrapper" value="#{recipes}" >
        <f:facet name="header">
            <h:outputText value="Recipes" />
        </f:facet>
        <rich:column id="selected">
            <h:selectBooleanCheckbox value="#{wrapper.selected}" />
        </rich:column>
        <rich:column id="id">
            <f:facet name="header">
                <h:outputText value="Id" />
            </f:facet>
            <h:outputText value="#{wrapper.recipe.id}" />
        </rich:column>
        <rich:column id="name">
            <f:facet name="header">
                <h:outputText value="Name" />
            </f:facet>
            <s:link id="recipe" value="#{wrapper.recipe.name}" propagation="none" view="/view/recipe.xhtml">
                <f:param name="recipeId" value="#{wrapper.recipe.id}"/>
            </s:link>
        </rich:column>
        <rich:column id="created_at">
            <f:facet name="header">Created At</f:facet>
            <h:outputText value="#{wrapper.recipe.createdAt}" />
        </rich:column>
        <rich:column id="updated_at">
            <f:facet name="header">Updated At</f:facet>
            <h:outputText value="#{wrapper.recipe.updatedAt}" />
        </rich:column>
    </rich:dataTable>

    <div class="actionButtons">
        <s:button id="done"
               value="Create Recipe"
                view="/view/recipe.xhtml" />
        <s:button id="import"
               value="Import Recipe"
                view="/view/recipeImport.xhtml" />        
        <h:commandButton id="print"
                      value="Print Selected Recipes"
                     action="#{recipeList.print}">
        </h:commandButton>
    </div>
    </h:form>
</ui:define>

</ui:composition>
